'use strict'

 const { DataTypes, Model, Op } = require('../../../azeroth').sequelize;
 class FlawType_2 extends Model { }

  const initFlawTypeData_2 = (sequelize_aim) => {
    FlawType_2.init(
         {
            id: {
                autoIncrement: true,
                type: DataTypes.INTEGER,
                allowNull: false,
                primaryKey: true
              },
              flaw_class_type: {
                type: DataTypes.INTEGER,
                allowNull: true,
                comment: "缺陷分分类code"
              },
              show: {
                type: DataTypes.STRING(255),
                allowNull: true,
                comment: "显示缺陷分类名"
              },
              color: {
                type: DataTypes.STRING(255),
                allowNull: true,
                comment: "显示颜色"
              },
              shape: {
                type: DataTypes.INTEGER,
                allowNull: true,
              }
         },
         {
             freezeTableName: true,
             sequelize: sequelize_aim,
             modelName: 'flaw_type',
             timestamps: false
         }
     )
  }

  FlawType_2.upload = async (data) => {
     let res = await FlawType_2.bulkCreate(data, {updateOnDuplicate: ['id']});
     return res;
 }

 module.exports = {
     FlawType_2,
     initFlawTypeData_2
 };